﻿@using Model.WeiXin.DTO
@using Model.WXshopBuiness.Enum
@using Xproject.Util
@using  Model.WXshopBuiness
@{
    Layout = "~/Views/Shared/_ShopLayout.cshtml";
    ViewBag.Title = "完善财务信息";
    string Domain = CommonHelper.GetAppSettings("Domin");
}
@model ZXUserInfoModel
<!DOCTYPE html>
<html>
<head>
    
    <style>
        .container {
            padding-right: 1px;
            padding-left: 1px;
        }
    </style>
 
 
    <!--页面内容
    <div id="yemnr">-->
    <!--头部-->
    <div class="container body-content" style="background:#fff; padding-left:0px;padding-right:0px;">

        <div class="top_c">
            <a href="@(Domain)/UserCenter/UserCenter" class="iconfont icon-jiantou-copy-copy"></a>
            <p class="titi">完善财务信息</p>
        </div>


       
        <div class="container" style="background:#fff; padding-left:0px;padding-right:0px; margin-left:5px;margin-top:4em">
            <div class="row" style="  margin-left:5px;margin-right:1px;margin-bottom: 5px;">
                <label for="Phone" class="col-xs-4 control-label" style="text-align:left;padding:0;margin:0">手机号码</label>
                <div class="col-xs-8">
                    <input class="form-control" name="Phone" id="Phone" placeholder="手机号码" value="@(Model!=null?Model.BindPhone:"")" required>
                </div>
            </div>
            <div class="row" style="  margin-left:5px;margin-right:1px;margin-bottom: 5px;">
                <label for="WeiXin" class="col-xs-4 control-label" style="text-align:left;padding:0;margin:0">微信号码</label>
                <div class="col-xs-8">
                    <input class="form-control" name="WeiXin" id="WeiXin" placeholder="请输入微信号码" required value="@(Model!=null?Model.BindWeiXin:"")">
                </div>
            </div>
            <div class="row" style="  margin-left:5px;margin-right:1px;margin-bottom: 5px;">
                <label for="ZhiFuBao" class="col-xs-4 control-label" style="text-align:left;padding:0;margin:0">支付宝账号</label>
                <div class="col-xs-8">
                    <input class="form-control" name="ZhiFuBao" id="ZhiFuBao" placeholder="请输入支付宝账号" required value="@(Model!=null?Model.BindZhiFuBao:"")">
                </div>
            </div>
            <div class="row" style="  margin-left:5px;margin-right:1px;margin-bottom: 5px;">
                <label for="bankCard" class="col-xs-4 control-label" style="text-align:left;padding:0;margin:0">银行卡账号</label>
                <div class="col-xs-8">
                    <input class="form-control" name="bankCard" id="bankCard" placeholder="请输入银行卡账号" required value="@(Model!=null?Model.BindBankCard:"")">
                </div>
            </div>
            <div class="row" style="  margin-left:5px;margin-right:1px;margin-bottom: 5px;">
                <label for="QQ" class="col-xs-4 control-label" style="text-align:left;padding:0;margin:0">QQ</label>
                <div class="col-xs-8">
                    <input class="form-control" name="QQ" id="QQ" placeholder="请输入QQ" required value="@(Model!=null?Model.BindQQ:"")">
                </div>
            </div>
            <label style="color:red;font-weight:bold">请仔细核对信息，奖金到账与此相关。</label>
            <div class="row">
               
                <button onclick="saveit()" class="deng" style="margin-top:3em;">保 存</button>
            </div>
        </div>
        
    </div>
    
    <script>

    function saveit() {
        var ZX_UserId = $("#ZX_UserId").val();
        var ZhiFuBao = $("#ZhiFuBao").val();
        var QQ = $("#QQ").val();
        var WeiXin = $("#WeiXin").val();
        var Phone = $("#Phone").val();
        var bankCard = $("#bankCard").val();
        var errorstr = "";
        var flag = true;
        
        if (Phone == '') {
            flag = false;
            errorstr = "没有填写手机号码";
        }
       
        if (Phone != '') {
            var mobilePatternHK = /^(\+852\s)?[5689]{1}\d{7}$/;
            if ((/^1[34578]\d{9}$/.test(Phone)) || mobilePatternHK.test(Phone)) {

                // flag = true;
            } else {
                errorstr = ("手机号码有误，请重填");
                flag = false;
            }

        }
        if (ZhiFuBao == '') {
            flag = false;
            errorstr = "没有填写支付宝号码";
        }
        if (QQ == '') {
            flag = false;
            errorstr = "没有填写QQ号码";
        }
        if (WeiXin == '') {
            flag = false;
            errorstr = "没有填写微信号码";
        }

        if (flag == false) {
            layer.open({
                content: errorstr
                , skin: 'msg'
                , time: 2 //2秒后自动关闭
            });
            return;
        }

           $.ajax({
            type: "POST",
            url: '@(Domain)/UserCenter/BindMyInfo',
            data: {
                Phone: Phone, WeiXin: WeiXin,
                ZhiFuBao: ZhiFuBao, QQ: QQ,
                bankCard: bankCard
            },
            cache: false,

            success: function (data) {
                layer.open({
                    content: data.Data
                    , skin: 'msg'
                    , time: 2 //2秒后自动关闭
                });
            }
        });
    }
    </script>
 

